package com.modemMgr.dao;

import com.modemMgr.util.DBAccessor;
import com.modemMgr.vo.Warehouse;

public class WarehouseDAO extends BaseDAO{
	public WarehouseDAO(DBAccessor dbAccessor) {
		super(dbAccessor);
	}

	public Warehouse getWarehouseByDetpId(String warehouseType, int deptId) throws Exception
	{
		String sql = "select * from warehouses where warehouse_type = ? and dept_id = ? ";
		return dbAccessor.queryObject(Warehouse.class, sql, new Object[]{warehouseType, deptId});
	}
	
	public Warehouse getWarehouseByUserId(String warehouseType, int userId) throws Exception
	{
		String sql = "select * from warehouses where warehouse_type = ? and user_id = ? ";
		return dbAccessor.queryObject(Warehouse.class, sql, new Object[]{warehouseType, userId});
	}
}
